package com.mdinfo.gw.door.web

import com.mdinfo.base.common.bean.CommonResult
import com.mdinfo.base.common.bean.DataGrid
import com.mdinfo.gw.door.param.DoorOpenTimeAddParam
import com.mdinfo.gw.door.param.DoorOpenTimeBindMultiCardParam
import com.mdinfo.gw.door.param.DoorOpenTimeListQueryParam
import com.mdinfo.gw.door.service.IDoorOpenTimeService
import com.mdinfo.gw.door.vo.DoorOpenTimeListQueryVo
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import javax.validation.Valid

/**
 * Created by Administrator on 2018/2/6.
 */
@RestController
@RequestMapping("/sys/doorOpenTime")
class DoorOpenTimeController(
        var doorOpenTimeService: IDoorOpenTimeService
){

    @RequestMapping("/add")
    fun add(@Valid param: DoorOpenTimeAddParam):CommonResult<Void>{
        return doorOpenTimeService.add(param)
    }

    @RequestMapping("/listQuery")
    fun listQuery(@Valid param: DoorOpenTimeListQueryParam)
            :CommonResult<DataGrid<DoorOpenTimeListQueryVo>>{
        return doorOpenTimeService.listQuery(param)
    }

    /**多张卡绑定到开放时间上*/
    @RequestMapping("/bindMultiCard")
    fun bindMultiCard(@Valid param: DoorOpenTimeBindMultiCardParam)
            :CommonResult<Void>{
        return doorOpenTimeService.bindMultiCard(param)
    }
}